<?php
if(!defined('BASEPATH')) exit('No direct script access allowed');
if(!function_exists('Create_Multi_Menu')){
    function Create_Multi_Menu($parentid,$list_category,$html='',$index=0,$res = '',$sep = ''){
        foreach($list_category as $item){
            $active = '';
            if($item->category_parent_id== $parentid){
                if($item->category_id == $index)
                    $active = 'selected="selected"';
                $re = sprintf($html,$item->category_id,$active,$sep.' '.$item->category_name);
                $res.= Create_Multi_Menu($item->category_id,$list_category,$html,$index,$re,$sep."--");
            }
        }
        return $res;
    }
}